#pragma once
#include "stdafx.h"
#include "CBaseApp.h"
#include "CGraphics.h"
#include "CFramework.h"
#include "CTimer.h"

class CFramework
{
public:
	CFramework( CBaseApp* pGameApp );
	~CFramework(void) { Release(); }

	BOOL Initialize ( char* title, HINSTANCE hInstance, int width, int height, BOOL windowed = true );
	
	HINSTANCE		m_hInstance;
	int				m_windowWidth;
	int				m_windowHeight;

	static LRESULT CALLBACK StaticWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);


	void Release();

private:
	LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );

	void				OnUpdateFrame(void);
	void				OnRenderFrame(void);

	void				OnLostDevice(void);


	CGraphics*			m_pGraphics;
	CBaseApp*			m_pGameApp;			
	CTimer*				m_pTimer;
	CInputDevice		m_mouse;
	CInputDevice		m_keyboard;

	BOOL				m_active;
};

